package com.example.demo.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.example.demo.model.User;
import com.example.demo.service.UserServiceImpl;

@Controller
@RequestMapping("/demo")
public class DemoController {
	
	@Autowired
	public UserServiceImpl userservice;

	@RequestMapping("/")
	public String defaultController(Map<String,Object> map) {
		final List<User> users = userservice.findAllUser();
		map.put("users", users);
		return "hello";
	}

	
}
